package etcd

import (
	"Godzilla/conf/databases"
	clientv3 "go.etcd.io/etcd/client/v3"
	"time"
)

func NewEtcdCli() (cli *clientv3.Client , err error) {
	var (
		Host    string
		Port    string
		dsn     string
	)

	Host = databases.GetEtcdConfig("Host")
	Port = databases.GetEtcdConfig("Port")

	dsn = Host +":"+Port

	cli, err = clientv3.New(clientv3.Config{
		Endpoints:            []string{dsn},
		DialTimeout:          10 * time.Second,
	})
	return cli, err
}

/**
在线用户 /inline/userid/ip:port
群所在的websocket服务端  /group/groupId-userid/ip:port
 */
